﻿<?xml version="1.0" encoding="utf-8"?>
<!--
        作者：          liuleyi
        更新时间：      20170515
        用途：          生成OGG进程参数
-->
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:fn="http://www.w3.org/2005/xpath-functions">
	<xsl:output method="text" indent="no" encoding="utf-8" byte-order-mark="no"/>  
	<xsl:template match="/">
	<xsl:variable name="StringTypeDefine" select="document('../model/0101_StringTypeDefine.xml')"/>
	<xsl:variable name="EnumTypeDefine" select="document('../model/0102_EnumTypeDefine.xml')"/>
	<xsl:variable name="BooleanTypeDefine" select="document('../model/0103_BooleanTypeDefine.xml')"/>
	<xsl:variable name="DateTypeDefine" select="document('../model/0104_DateTypeDefine.xml')"/>
	<xsl:variable name="NumberTypeDefine" select="document('../model/0105_NumberTypeDefine.xml')"/>
	<xsl:variable name="IntegerTypeDefine" select="document('../model/0106_IntegerTypeDefine.xml')"/>
<xsl:for-each select="Processes/Process">
<xsl:variable name="fileName" select="concat('./generate/ogg/prm/',@code,'.prm')"/>
<xsl:result-document encoding="utf-8" method="text" href="{$fileName}"> 
REPLICAT <xsl:value-of select="@code"/>
SETENV (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")
USERID yjgk@yjgk1,PASSWORD sgyjgk2016
REPORT AT 06:00
REPORTCOUNT EVERY 25 MINUTES, RATE
REPORTROLLOVER AT 02:00
REPERROR DEFAULT, ABEND
GETTRUNCATES
ALLOWNOOPUPDATES
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/<xsl:value-of select="@code"/>.dsc, APPEND, MEGABYTES 1024M
DISCARDROLLOVER AT 02:30
SOURCEDEFS ./dirdef/pms.defgen

<xsl:for-each select="Table">
MAP SCYW.<xsl:value-of select="@pms_table"/> , TARGET YJGK.<xsl:value-of select="@yjgk_table"/> , COLMAP( <xsl:for-each select="Column"> <xsl:value-of select="@yjgk_column"/> = <xsl:value-of select="@pms_column"/> <xsl:if test="position()!=last()"> , </xsl:if></xsl:for-each> )  , handlecollisions ;
</xsl:for-each>

</xsl:result-document>
</xsl:for-each>
</xsl:template>  
</xsl:stylesheet>